<%@ page contentType="text/html;charset=UTF-8" %>
<%@ include file="/WEB-INF/views/include/taglib.jsp"%>
<html>
<head>
	<title>日志命令管理</title>
	<meta name="decorator" content="default"/>
	<script type="text/javascript">
		$(document).ready(function() {
			
		});
		function page(n,s){
			$("#pageNo").val(n);
			$("#pageSize").val(s);
			$("#searchForm").submit();
        	return false;
        }
	</script>
</head>
<body>
	<ul class="nav nav-tabs">
		<li class="active">
			<a href="${ctx}/equipment/eleEquipmentCommand/">
				<spring:message code="command.list"/>
			</a>
		</li>
	</ul>
	<form:form id="searchForm" modelAttribute="eleEquipmentCommand" action="${ctx}/equipment/eleEquipmentCommand/" method="post" class="breadcrumb form-search">	
		<ul class="ul-form">
		   <li>
		   <label><spring:message code="common.device.id"/>：</label>
                <form:input path="mac" htmlEscape="false" maxlength="200" class="input-medium"/>
            </li>
			<li class="btns"><input id="btnSubmit" class="btn btn-primary" type="submit" value="<spring:message code='common.Query'/>"/></li>
			<li class="clearfix"></li>
		</ul>
	</form:form>
	<sys:message content="${message}"/>
	<table id="contentTable" class="table table-striped table-bordered table-condensed">
		<thead>
			<tr>
				<th><spring:message code="command.type"/> </th>
				<th><spring:message code="common.device.id"/></th>
				<th><spring:message code='common.update_time'/></th>
				<th><spring:message code='common.remarks'/></th>
				<shiro:hasPermission name="equipment:eleEquipmentCommand:edit">
					<th><spring:message code='common.operation'/></th>
				</shiro:hasPermission>
			</tr>
		</thead>
		<tbody>
		<c:forEach items="${monitors}" var="ele">
			<tr>
				<td><spring:message code="device.monitor"/></td>
				<td>${ele.code}</td>
				<td>
					<fmt:formatDate value="${ele.updateDate}" pattern="yyyy-MM-dd HH:mm:ss"/>
				</td>
				<td>
					${ele.remarks}
				</td>
				<shiro:hasPermission name="equipment:eleEquipmentCommand:edit"><td>
					<a href="${ctx}/equipment/eleEquipmentCommand/cancel?commandId=${ele.id}&type=monitor"
					   onclick="return confirmx('<spring:message code="tips.cancelconfirm"/>', this.href)">
						<spring:message code="common.cancel"/>
					</a>
				</td></shiro:hasPermission>
			</tr>
		</c:forEach>
		<c:forEach items="${commands}" var="ele">
			<tr>
				<td><spring:message code="device.synchronizing"/></td>
				<td>${ele.mac}</td>
				<td>
					<fmt:formatDate value="${ele.updateDate}" pattern="yyyy-MM-dd HH:mm:ss"/>
				</td>
				<td>
					${ele.remarks}
				</td>
				<shiro:hasPermission name="equipment:eleEquipmentCommand:edit"><td>
					<a href="${ctx}/equipment/eleEquipmentCommand/cancel?commandId=${ele.id}&type=command"
					   onclick="return confirmx('<spring:message code="tips.cancelconfirm"/>', this.href)">
						<spring:message code="common.cancel"/>
					</a>
				</td></shiro:hasPermission>
			</tr>
		</c:forEach>
		<c:forEach items="${groups}" var="ele">
			<tr>
				<td><spring:message code="publishresourcepackage"/></td>
				<td>${ele.mac}</td>
				<td>
					<fmt:formatDate value="${ele.updateDate}" pattern="yyyy-MM-dd HH:mm:ss"/>
				</td>
				<td>
					${ele.remarks}
				</td>
				<shiro:hasPermission name="equipment:eleEquipmentCommand:edit"><td>
					<a href="${ctx}/equipment/eleEquipmentCommand/cancel?commandId=${ele.id}&type=group"
					   onclick="return confirmx('<spring:message code="tips.cancelconfirm"/>', this.href)">
						<spring:message code="common.cancel"/>
					</a>
				</td></shiro:hasPermission>
			</tr>
		</c:forEach>
		<c:forEach items="${templets}" var="ele">
			<tr>
				<td><spring:message code="publishinginterfacepackage"/></td>
				<td>${ele.equipment.code}</td>
				<td>
					<fmt:formatDate value="${ele.updateDate}" pattern="yyyy-MM-dd HH:mm:ss"/>
				</td>
				<td>
					${ele.remarks}
				</td>
				<shiro:hasPermission name="equipment:eleEquipmentCommand:edit"><td>
					<a href="${ctx}/equipment/eleEquipmentCommand/cancel?commandId=${ele.id}&type=template"
					   onclick="return confirmx('<spring:message code="tips.cancelconfirm"/>', this.href)">
						<spring:message code="common.cancel"/>
					</a>
				</td></shiro:hasPermission>
			</tr>
		</c:forEach>
		</tbody>
	</table>
</body>
</html>